package org.edu.page;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.util.List;

@ApiModel(value="PageResult", description="分页返回对象")
public class PageResult<T>
{
    @ApiModelProperty(value="总记录数", name="totalCount", example="50")
    private long totalCount;
    @ApiModelProperty(value="每页记录数", name="pageSize", example="10")
    private int pageSize;
    @ApiModelProperty(value="总页数", name="totalPage", example="5")
    private long totalPage;
    @ApiModelProperty(value="当前页数", name="currPage", example="1")
    private int currPage;
    @ApiModelProperty(value="列表数据", name="items")
    private List<T> items;

    public void setTotalPage(long totalPage)
    {
        this.totalPage = totalPage;
    }

    public int hashCode()
    {
        int PRIME = 59;int result = 1;long $totalCount = getTotalCount();result = result * 59 + (int)($totalCount >>> 32 ^ $totalCount);result = result * 59 + getPageSize();long $totalPage = getTotalPage();result = result * 59 + (int)($totalPage >>> 32 ^ $totalPage);result = result * 59 + getCurrPage();Object $items = getItems();result = result * 59 + ($items == null ? 43 : $items.hashCode());return result;
    }

    protected boolean canEqual(Object other)
    {
        return other instanceof PageResult;
    }

    public boolean equals(Object o)
    {
        if (o == this) {
            return true;
        }
        if (!(o instanceof PageResult)) {
            return false;
        }
        PageResult<?> other = (PageResult)o;
        if (!other.canEqual(this)) {
            return false;
        }
        if (getTotalCount() != other.getTotalCount()) {
            return false;
        }
        if (getPageSize() != other.getPageSize()) {
            return false;
        }
        if (getTotalPage() != other.getTotalPage()) {
            return false;
        }
        if (getCurrPage() != other.getCurrPage()) {
            return false;
        }
        Object this$items = getItems();Object other$items = other.getItems();return this$items == null ? other$items == null : this$items.equals(other$items);
    }

    public void setItems(List<T> items)
    {
        this.items = items;
    }

    public void setTotalCount(long totalCount)
    {
        this.totalCount = totalCount;
    }

    public void setPageSize(int pageSize)
    {
        this.pageSize = pageSize;
    }

    public String toString()
    {
        return "PageResult(totalCount=" + getTotalCount() + ", pageSize=" + getPageSize() + ", totalPage=" + getTotalPage() + ", currPage=" + getCurrPage() + ", items=" + getItems() + ")";
    }

    public void setCurrPage(int currPage)
    {
        this.currPage = currPage;
    }

    public long getTotalCount()
    {
        return this.totalCount;
    }

    public int getPageSize()
    {
        return this.pageSize;
    }

    public long getTotalPage()
    {
        return this.totalPage;
    }

    public int getCurrPage()
    {
        return this.currPage;
    }

    public List<T> getItems()
    {
        return this.items;
    }
}
